<?php

namespace common\model;

use think\model\RelationModel;

class MessageTaskConfirmModel extends RelationModel
{
    const SOURCE_TYPE_RELATION_CHANGE = 'relation_change';
    const SOURCE_TYPE_REPAIR = 'repair';
    const SOURCE_TYPE_DEPRECATED = 'deprecated';
    const SOURCE_TYPE_VERSION_PUBLISH = 'version_publish';
    const SOURCE_TYPE_GLOBAL_NOTICE_CONFIRM = 'global_notice_confirm';
    const SOURCE_TYPE_GLOBAL_NOTICE_AT = 'global_notice_at';

    //自动验证
    protected $_validate = [
        ['link_id', '', '', self::MUST_VALIDATE, 'require', self::MODEL_INSERT], // 必须字段
        ['link_module_code', '', '', self::MUST_VALIDATE, 'require', self::MODEL_INSERT], // 必须字段
        ['source_type', '', '', self::MUST_VALIDATE, 'require', self::MODEL_INSERT], // 必须字段
    ];

    //自动完成
    protected $_auto = [
        ['created_by', 'fill_created_by', self::MODEL_INSERT, 'function'],
        ['created', 'time', self::MODEL_INSERT, 'function'],
        ['tenant_id', 'auto_fill_tenant_id', self::MODEL_INSERT, 'function'],
    ];
}
